<?php

namespace App\Controller\Web;

use App\Base\BaseController4Web;
use App\Base\BaseForm;
use App\Base\FormCreator;
use App\Entity\ClassOrder;
use App\Model\ArtCategoryModel;
use App\Project\ZhengHuaModel;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;

class FromSubmitController extends BaseController4Web
{
    /**
     * @route("/JoinClass",name="JoinClass")
     */
    public function JoinClass(Request $request)
    {
        $fc = new FormCreator();
        $entity = $fc->fillEntity(new ClassOrder(),$request,["name"=>"","phone"=>"","school"=>"","class"=>""]);
        /**@var  $entity \App\Entity\ClassOrder*/
        $entity->setAddtime(time())->setStatus(0)->setMsg("未处理");
        $this->myEm()->persist($entity);$this->myEm()->flush();
        return $this->json_out(1,"提交成功");
    }
}
